package ca.etsmtl.log730.lab3.controllers2;

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

import ca.etsmtl.log730.lab3.controllers2.Communicator.ObjectReaderHandler;
import ca.etsmtl.log730.lab3.events.bank.HelloEvent;

public class TestClient implements ObjectReaderHandler {
	public static void main(String args[]) {
		try {
			TestClient tt = new TestClient();
			
			Communicator communicator = new Communicator(new Socket("localhost", 1234));
			Communicator.InputHandler ci = communicator.createInputHandler();
			Communicator.OutputHandler co = communicator.createOutputHandler();
//			communicator.start();
			co.addObject(new HelloEvent("lol",null));
//			ci.addListener(tt);
			co.start();
//			ci.start();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void handle(Object o) {
		System.out.println(o.toString());
		
	}
}
